import request from '@/utils/request'

// 查询项目合同列表
export function listDealContractDebt(query) {
  return request({
    url: '/contract/dealContractDebt/list',
    method: 'get',
    params: query
  })
}

// 查询项目合同详细
export function getDealContractDebt(id) {
  return request({
    url: '/contract/dealContractDebt/' + id,
    method: 'get'
  })
}

// 验证当前投资金额是否超过了监控指数
/*
export function validInvestMonitor(query) {
  return request({
    url: '/contract/dealContractDebt/validInvestMonitor',
    method: 'get',
    params: query
  })
}
*/

// 保存项目合同
export function saveDealContractDebt(data) {
  return request({
    url: '/contract/dealContractDebt/save',
    method: 'post',
    data: data
  })
}

// 删除项目合同
export function delDealContractDebt(id) {
  return request({
    url: '/contract/dealContractDebt/' + id,
    method: 'delete'
  })
}

// 删除项目合同条款
export function delDealContractDebtByTerms(id) {
  return request({
    url: '/contract/dealContractDebt/terms/' + id,
    method: 'delete'
  })
}

// 导出项目合同
export function exportDealContractDebt(query) {
  return request({
    url: '/contract/dealContractDebt/export',
    method: 'get',
    params: query
  })
}

// 变更合同
export function changeDealContractDebt(data) {
  return request({
    url: '/contract/dealContractDebt/change',
    method: 'post',
    data: data
  })
}

// 中止变更
export function terminationChange(id) {
  return request({
    url: '/contract/dealContractDebt/terminationChange/' + id,
    method: 'get'
  })
}

// 比对合同
export function contractComparisonDifferences(data) {
  return request({
    url: '/contract/dealContractDebt/contractComparisonDifferences',
    method: 'post',
    data: data
  })
}

export function fallback(id) {
  return request({
    url: '/contract/dealContractDebt/fallback/' + id,
    method: 'get'
  })
}
